<script lang="ts" setup>
  import type { GameSignImportItem } from '@/types/game';

  defineProps<{
    list: GameSignImportItem[];
  }>();

  const emit = defineEmits(['close']);
</script>

<template>
  <a-modal
    title="导入结果"
    :width="800"
    visible
    :footer="false"
    @cancel="emit('close')"
  >
    <a-table
      size="small"
      :pagination="false"
      :bordered="{ cell: true }"
      :data="list"
    >
      <template #columns>
        <a-table-column title="行号" data-index="lineIndex">
          <template #cell="{ record }">{{ record.lineIndex + 2 }}</template>
        </a-table-column>
        <a-table-column title="状态" data-index="isSuccess">
          <template #cell="{ record }">
            <a-tag :color="record.isSuccess ? 'green' : 'red'">
              {{ record.isSuccess ? '成功' : '失败' }}
            </a-tag>
          </template>
        </a-table-column>
        <a-table-column title="失败原因" data-index="failReason" />
      </template>
    </a-table>
  </a-modal>
</template>
